home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
misc
/
emu
/
ATUtilities.lha
/
ATUtilities
/
serv.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-09-26
|
1KB
|
63 lines
#include <exec/types.h>
#include "intuition/intuition.h"
#include "janus.h"
struct Library *JanusBase,*ATUtilitiesBase;
struct ServiceData *sd=NULL;
struct Window *c;
UBYTE *mem;
LONG a,b,q,sig;
VOID main()
{
JanusBase=OpenLibrary("janus.library",0L);
if(JanusBase!=NULL)
{
ATUtilitiesBase=OpenLibrary("at-utilities.library",0L);
if(ATUtilitiesBase!=NULL)
{
c=CreateStdWindow("AddService $74667466/$1001",
75,75,450,100,
CLOSEWINDOW|VANILLAKEY,WINDOWCLOSE|WINDOWDEPTH|WINDOWDRAG);
if(c!=NULL)
{
sig=AllocSignal(-1);
a=AddService(&sd,0x74667466,0x1001,16,MEMF_PARAMETER|MEM_BYTEACCESS,sig,ADDS_TOPC_ONLY);
if(a==JSERV_OK)
{
mem=sd->AmigaMemPtr;
printf("Amiga: $%08lx\n",mem);
printf("PC: $%08lx\n",sd->PCMemPtr);
q=1;
do
{
printf("PC: %08lx\n",sd->FirstPCCustomer);
printf("Call(%ld)\n",q);
mem[0]=q;
CallService(sd);
Delay(100);
q++; if(q>15) q=1;
b=GetMsg(c->UserPort);
} while(b==NULL);
ReplyMsg(b);
printf("DeleteSerice()\n");
DeleteService(sd);
}
else
{
printf("Fehler: %ld\n",a);
}
FreeSignal(sig);
DeleteStdWindow(c);
}
CloseLibrary(ATUtilitiesBase);
}
CloseLibrary(JanusBase);
}
}